﻿using System;
using System.Collections.Generic;

namespace Truncation.Detector.WPF
{
    public class Result
    {
        private string _fileName;
        private string _label;
        private int _line;
        private HashSet<string> _langs = new HashSet<string>(); 
        public int Line
        {
            get { return _line; }
            set { _line = value; }
        }

        public string Label
        {
            get { return _label; }
            set { _label = value; }
        }

        public string FileName
        {
            get { return _fileName; }
            set { _fileName = value; }
        }

        public bool Contain(string lang)
        {
            return _langs.Contains(lang);
        }

        public void Append(string lang)
        {
            _langs.Add(lang);
        }

        public override string ToString()
        {
            string context = String.Format("{0}: {1}", Label, String.Join(",", _langs));
            return String.Format("{0},{1},{2},{3},{4},{5},{6}", FileName, Line, 0, 100, "Warning", 5003, context);
        }
    }
}